#pragma once

#include "includeBase.h"
#include "../common/BasePclModel.h"

class EuclideanClusterExtractionModel : public BasePclModel
{
public:
    EuclideanClusterExtractionModel();

public:
    static EuclideanClusterExtractionModel& get();

public: // IJsonSerializable
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    QJsonObject toJson() const override;

public: // Property
    QString pcdFile() const { return pcdFile_; }
    void setPcdFile(const QString& pcdFile) { pcdFile_ = pcdFile; }

    double leafSize() const { return leafSize_; }
    void setLeafSize(double leafSize) { leafSize_ = leafSize; }

    int segMaxIterations() const { return segMaxIterations_; }
    void setSegMaxIterations(int segMaxIterations) { segMaxIterations_ = segMaxIterations; }

    int filterPercent() const { return filterPercent_; }
    void setFilterPercent(int filterPercent) { filterPercent_ = filterPercent; }

    double segDistanceThreshold() const { return segDistanceThreshold_; }
    void setSegDistanceThreshold(double segDistanceThreshold) { segDistanceThreshold_ = segDistanceThreshold; }

    double ecClusterTolerance() const { return ecClusterTolerance_; }
    void setEcClusterTolerance(double ecClusterTolerance) { ecClusterTolerance_ = ecClusterTolerance; }

    int ecMinClusterSize() const { return ecMinClusterSize_; }
    void setEcMinClusterSize(int ecMinClusterSize) { ecMinClusterSize_ = ecMinClusterSize; }

    int ecMaxClusterSize() const { return ecMaxClusterSize_; }
    void setEcMaxClusterSize(int ecMaxClusterSize) { ecMaxClusterSize_ = ecMaxClusterSize; }

private:
    QString pcdFile_ = "<pcl-data>/tutorials/table_scene_lms400.pcd";

    double leafSize_ = 0.01;
    int segMaxIterations_ = 100;
    double segDistanceThreshold_ = 0.02;
    int filterPercent_ = 70;
    double ecClusterTolerance_ = 0.02;
    int ecMinClusterSize_ = 100;
    int ecMaxClusterSize_ = 250000;
};
